package com.example.shilehui;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;
import cn.jhc.bean.EnCashInfo;
import cn.jhc.service.HelpTopicDataService;
import cn.jhc.service.PersonInfoService;
import cn.jhc.utils.Strings;


public class EnCashInfoActivity extends Activity {
	
	
	 private TextView _titleTextView;
	 private ImageView _backImageView;
	 private TextView _titleRightTextView;
	 private ImageView _titleRightImageView;
	 private String _content;
	 
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		Intent intent=getIntent();
		_content=intent.getStringExtra(Strings.EN_CASH);
		init();
		
		
	}
	
	private void init(){
		
		
		setContentView(R.layout.encash_layout);
		
		setTitleStyle();
		setWebView();
	}
	
	private void setTitleStyle(){
		 _titleTextView=(TextView)findViewById(R.id.title_middle);
		 _backImageView=(ImageView)findViewById(R.id.title_left_imageview);
		 _titleRightTextView=(TextView)findViewById(R.id.title_right_textview);
		 _titleRightImageView=(ImageView)findViewById(R.id.title_right_imageview);
		 
		 
		 _titleTextView.setText(R.string.en_cash);
		 _titleTextView.setTextColor(Color.WHITE);
		 _titleTextView.setTextSize(18);
		 _titleTextView.setGravity(Gravity.CENTER);
		 
		 
		 _backImageView.setImageResource(R.drawable.left_icon);
		 _backImageView.setOnClickListener(new onViewClickListener());
		 _titleRightImageView.setVisibility(View.GONE);
		 _titleRightTextView.setVisibility(View.GONE);
	}
	
	 private class onViewClickListener implements OnClickListener{

			@Override
			public void onClick(View v) {
				switch(v.getId()){
					case R.id.title_left_imageview:
						finish();
						break;
				}
				
			}
			 
	}
	  
	 private void setWebView(){
		 WebView webView=(WebView)findViewById(R.id.encash_webview);
		 webView.getSettings().setDefaultTextEncodingName("UTF-8") ;
		 webView.loadData(_content, "text/html; charset=UTF-8", null);
		 
	 }
}
